﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplicationExceptionHandling
{
    public class Wallet
    {
        private decimal Amount { get; set; }
        public void Add(decimal amount)
        {
            Amount += amount;
        }

        public void Remove(decimal amount)
        {
            if (amount > Amount)
            {
                var exception = new NotEnoughAmountException("Not enough amount in wallet.", amount - Amount);
                throw exception; 
            }
            else
            {
                Amount -= amount;
            }
        }
    }
}
